package org.cloud.jiangyoucommon.common;

import org.cloud.jiangyoucommon.enums.HttpStatusEnum;

/**
 * 自定义运行时异常
 */
public class BaseException extends RuntimeException{
    /**
     * 错误信息码
     */
    private Integer code;

    /**
     * 错误提示信息
     */
    private String message;

    public BaseException() {
        super();
    }

    public BaseException(HttpStatusEnum statusEnum) {
        super(statusEnum.getMessage());
        this.code = statusEnum.getCode();
        this.message = statusEnum.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
